/**
 * Demo 自定义样式
 */

/* 全局样式重置 */
* {
  box-sizing: border-box;
}
:root {
  --el-bg-color: #000;
}
body {
  margin: 0;
  padding: 0;
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: var(--el-bg-color-page);
  color: var(--el-text-color-primary);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--el-fill-color-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--el-border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--el-border-color-dark);
}

/* 暗色主题滚动条 */
.dark ::-webkit-scrollbar-track {
  background: var(--el-fill-color-dark);
}

.dark ::-webkit-scrollbar-thumb {
  background: var(--el-border-color-dark);
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: var(--el-border-color-darker);
}

/* 卡片样式增强 */
.demo-card {
  transition: all 0.3s ease;
  border: 1px solid var(--el-border-color-lighter);
}

.demo-card:hover {
  box-shadow: var(--el-box-shadow-light);
  transform: translateY(-2px);
}

/* 按钮组样式 */
.button-group .el-button {
  margin-right: 8px;
  margin-bottom: 8px;
}

/* 表单样式增强 */
.demo-section .el-form {
  background: var(--el-bg-color);
  padding: 20px;
  border-radius: var(--el-border-radius-base);
  border: 1px solid var(--el-border-color-lighter);
}

/* 表格样式增强 */
.demo-section .el-table {
  border-radius: var(--el-border-radius-base);
  overflow: hidden;
  border: 1px solid var(--el-border-color-lighter);
}

/* 主题预览样式 */
.theme-preview {
  padding: 20px;
  background: var(--el-fill-color-lighter);
  border-radius: var(--el-border-radius-base);
  border: 1px solid var(--el-border-color-lighter);
}

/* 颜色配置样式 */
.color-config .el-form-item {
  margin-bottom: 15px;
}

.color-config .el-color-picker {
  width: 100%;
}

/* 样式配置滑块 */
.style-config .el-slider {
  margin-top: 10px;
}

/* 语言配置样式 */
.language-config {
  padding: 20px;
}

/* 日期时间演示样式 */
.datetime-demo {
  padding: 20px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .demo-content {
    padding: 0 10px;
  }
}

@media (max-width: 768px) {
  .demo-main {
    padding: 10px;
  }
  
  .demo-card {
    margin-bottom: 15px;
  }
  
  .button-group {
    justify-content: center;
  }
  
  .button-group .el-button {
    margin: 4px;
  }
  
  .theme-preview {
    padding: 15px;
  }
  
  .color-config,
  .style-config,
  .language-config,
  .datetime-demo {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .header-content {
    flex-direction: column;
    gap: 10px;
  }
  
  .header-content h1 {
    font-size: 20px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: center;
  }
  
  .demo-main {
    padding: 5px;
  }
  
  .demo-section h2 {
    font-size: 18px;
    margin-bottom: 15px;
  }
}

/* 动画效果 */
.demo-card,
.demo-section .el-form,
.demo-section .el-table {
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 加载状态 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

/* 空状态 */
.empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--el-text-color-placeholder);
}

/* 错误状态 */
.error {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--el-color-danger);
}

/* 成功状态 */
.success {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--el-color-success);
}

/* 打印样式 */
@media print {
  .demo-header,
  .demo-sidebar,
  .header-actions {
    display: none !important;
  }
  
  .demo-container {
    height: auto !important;
  }
  
  .demo-main {
    padding: 0 !important;
  }
  
  .demo-card {
    break-inside: avoid;
    margin-bottom: 10px;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .demo-card {
    border-width: 2px;
  }
  
  .button-group .el-button {
    border-width: 2px;
  }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
  .demo-card,
  .demo-section .el-form,
  .demo-section .el-table {
    animation: none;
  }
  
  .demo-card:hover {
    transform: none;
  }
}

/* 焦点样式 */
.demo-card:focus-within,
.demo-section .el-form:focus-within {
  outline: 2px solid var(--el-color-primary);
  outline-offset: 2px;
}

/* 选择样式 */
::selection {
  background-color: var(--el-color-primary-light-7);
  color: var(--el-color-primary-dark-2);
}

/* 暗色主题选择样式 */
.dark ::selection {
  background-color: var(--el-color-primary-light-3);
  color: var(--el-color-primary-light-9);
}
